import {RoleVo} from "@/api/sys/admin/role/types";

/**
 * 登录用户信息
 */
export type UserLoginType = {
    username: string
    password: string
}

/**
 * 用户登录返回的token
 */
export type UserLoginResultType = {
    accessToken: string,
    tokenType: 'Bearer '
}

/**
 * 用户table列表
 */
export type UserVo = {
    id: number,
    username: string,
    password: string,
    nickname: string,
    gender: number,
    avatar?: string,
    email?: string
    status?: number,
    remark?: string,
    roles?: RoleVo[]
}

/**
 * 用于查询的,包含roleId
 */
export type UserQueryVo = Partial<UserVo> & Omit<UserVo, 'roles'> & { roleId: number }

/**
 * 用户表单数据
 */
export type UserVoPartial = Partial<UserVo>

/**
 * 重置密码
 */
export type ResetPasswordType = {
    id: number,
    password?: string
    // 验证密码,和上面保持一样验证通过
    rePassword?: string
}

/**
 * 用户获取权限时候的信息
 */

/**
 * 登录用户信息
 */
export type UserPermsInfoType = {
    id: number;
    nickname: string;
    avatar: string;
    roles: string[];
    perms: string[];
}


/**
 * 设置角色
 */

export type SetRolesType = {
    id?: number
    roleIds?: number[]
}